package com.xiguaji.tiktok.v1.tiktok.mytiktok.repository;

import com.xiguaji.tiktok.v1.tiktok.mytiktok.model.TGroup;
import org.springframework.data.repository.CrudRepository;

import java.util.List;
import java.util.Optional;

public interface TGroupRepository extends CrudRepository<TGroup,Long> {

    List<TGroup> findByUserIdOrderByGroupSortDesc(long userId);

    Optional<TGroup> findByNameAndUserId(String name, long userId);

    Optional<TGroup> findByNameAndUserIdAndIdNot(String name, long userId,long id);


}
